home *** CD-ROM | disk | FTP | other *** search
/ QuickTime 2.0 Developer Kit / QuickTime 2.0 Developer Kit.iso / mac / MAC / Programming Stuff / Interfaces / PInterfaces / ImageCodec.p < prev    next >
Encoding:
Text File  |  1994-11-11  |  7.1 KB  |  234 lines  |  [TEXT/MPS ]

  1. {
  2.      File:        ImageCodec.p
  3.  
  4.      Copyright:    © 1984-1994 by Apple Computer, Inc.
  5.                  All rights reserved.
  6.  
  7.      Version:    Universal Interfaces 2.0a3  ETO #16, MPW prerelease.  Friday, November 11, 1994. 
  8.  
  9.      Bugs?:        If you find a problem with this file, send the file and version
  10.                  information (from above) and the problem description to:
  11.  
  12.                      Internet:    apple.bugs@applelink.apple.com
  13.                      AppleLink:    APPLE.BUGS
  14.  
  15. }
  16.  
  17. {$IFC UNDEFINED UsingIncludes}
  18. {$SETC UsingIncludes := 0}
  19. {$ENDC}
  20.  
  21. {$IFC NOT UsingIncludes}
  22.  UNIT ImageCodec;
  23.  INTERFACE
  24. {$ENDC}
  25.  
  26. {$IFC UNDEFINED __IMAGECODEC__}
  27. {$SETC __IMAGECODEC__ := 1}
  28.  
  29. {$I+}
  30. {$SETC ImageCodecIncludes := UsingIncludes}
  31. {$SETC UsingIncludes := 1}
  32.  
  33.  
  34. {$IFC UNDEFINED __TYPES__}
  35. {$I Types.p}
  36. {$ENDC}
  37. {    ConditionalMacros.p                                            }
  38.  
  39. {$IFC UNDEFINED __QUICKDRAW__}
  40. {$I Quickdraw.p}
  41. {$ENDC}
  42. {    MixedMode.p                                                    }
  43. {    QuickdrawText.p                                                }
  44.  
  45. {$IFC UNDEFINED __QDOFFSCREEN__}
  46. {$I QDOffscreen.p}
  47. {$ENDC}
  48. {    Errors.p                                                    }
  49.  
  50. {$IFC UNDEFINED __WINDOWS__}
  51. {$I Windows.p}
  52. {$ENDC}
  53. {    Memory.p                                                    }
  54. {    Events.p                                                    }
  55. {        OSUtils.p                                                }
  56. {    Controls.p                                                    }
  57. {        Menus.p                                                    }
  58.  
  59. {$IFC UNDEFINED __IMAGECOMPRESSION__}
  60. {$I ImageCompression.p}
  61. {$ENDC}
  62. {    Components.p                                                }
  63. {    StandardFile.p                                                }
  64. {        Dialogs.p                                                }
  65. {            TextEdit.p                                            }
  66. {        Files.p                                                    }
  67.  
  68. {$IFC UNDEFINED __MOVIES__}
  69. {$I Movies.p}
  70. {$ENDC}
  71. {    Aliases.p                                                    }
  72. {        AppleTalk.p                                                }
  73.  
  74. {$PUSH}
  75. {$ALIGN MAC68K}
  76. {$LibExport+}
  77.  
  78. CONST
  79.     codecGetCodecInfo            = $00;
  80.     codecGetCompressionTime        = $01;
  81.     codecGetMaxCompressionSize    = $02;
  82.     codecPreCompress            = $03;
  83.     codecBandCompress            = $04;
  84.     codecPreDecompress            = $05;
  85.     codecBandDecompress            = $06;
  86.     codecCDSequenceBusy            = $07;
  87.     codecGetCompressedImageSize    = $08;
  88.     codecGetSimilarity            = $09;
  89.     codecTrimImage                = $0A;
  90.     codecRequestSettings        = $0B;
  91.     codecGetSettings            = $0C;
  92.     codecSetSettings            = $0D;
  93.     codecCDSequenceFlush        = $0E;
  94.     codecSetTimeCode            = $0F;
  95.  
  96.     codecCanScale                = 1 * (2**(0));
  97.     codecCanMask                = 1 * (2**(1));
  98.     codecCanMatte                = 1 * (2**(2));
  99.     codecCanTransform            = 1 * (2**(3));
  100.     codecCanTransferMode        = 1 * (2**(4));
  101.     codecCanCopyPrev            = 1 * (2**(5));
  102.     codecCanSpool                = 1 * (2**(6));
  103.     codecCanClipVertical        = 1 * (2**(7));
  104.     codecCanClipRectangular        = 1 * (2**(8));
  105.     codecCanRemapColor            = 1 * (2**(9));
  106.     codecCanFastDither            = 1 * (2**(10));
  107.     codecCanSrcExtract            = 1 * (2**(11));
  108.     codecCanCopyPrevComp        = 1 * (2**(12));
  109.     codecCanAsync                = 1 * (2**(13));
  110.     codecCanMakeMask            = 1 * (2**(14));
  111.     codecCanShift                = 1 * (2**(15));
  112.     codecCanAsyncWhen            = 1 * (2**(16));
  113.     codecCanShieldCursor        = 1 * (2**(17));
  114.     codecCanManagePrevBuffer    = 1 * (2**(18));
  115.  
  116.  
  117. TYPE
  118.     CodecCapabilities = RECORD
  119.         flags:                    LONGINT;
  120.         wantedPixelSize:        INTEGER;
  121.         extendWidth:            INTEGER;
  122.         extendHeight:            INTEGER;
  123.         bandMin:                INTEGER;
  124.         bandInc:                INTEGER;
  125.         pad:                    INTEGER;
  126.         time:                    LONGINT;
  127.     END;
  128.  
  129. CONST
  130.     codecConditionFirstBand        = 1 * (2**(0));
  131.     codecConditionLastBand        = 1 * (2**(1));
  132.     codecConditionFirstFrame    = 1 * (2**(2));
  133.     codecConditionNewDepth        = 1 * (2**(3));
  134.     codecConditionNewTransform    = 1 * (2**(4));
  135.     codecConditionNewSrcRect    = 1 * (2**(5));
  136.     codecConditionNewMask        = 1 * (2**(6));
  137.     codecConditionNewMatte        = 1 * (2**(7));
  138.     codecConditionNewTransferMode = 1 * (2**(8));
  139.     codecConditionNewClut        = 1 * (2**(9));
  140.     codecConditionNewAccuracy    = 1 * (2**(10));
  141.     codecConditionNewDestination = 1 * (2**(11));
  142.     codecConditionFirstScreen    = 1 * (2**(12));
  143.     codecConditionDoCursor        = 1 * (2**(13));
  144.     codecConditionCatchUpDiff    = 1 * (2**(14));
  145.     codecConditionCodecChangedMask = 1 * (2**(31));
  146.  
  147.     codecInfoResourceType        = 'cdci';
  148.     codecInterfaceVersion        = 2;
  149.  
  150.  
  151. TYPE
  152.     CodecCompressParams = RECORD
  153.         sequenceID:                ImageSequence;
  154.         imageDescription:        ImageDescriptionHandle;
  155.         data:                    Ptr;
  156.         bufferSize:                LONGINT;
  157.         frameNumber:            LONGINT;
  158.         startLine:                LONGINT;
  159.         stopLine:                LONGINT;
  160.         conditionFlags:            LONGINT;
  161.         callerFlags:            CodecFlags;
  162.         capabilities:            ^CodecCapabilities;
  163.         progressProcRecord:        ICMProgressProcRecord;
  164.         completionProcRecord:    ICMCompletionProcRecord;
  165.         flushProcRecord:        ICMFlushProcRecord;
  166.         srcPixMap:                PixMap;
  167.         prevPixMap:                PixMap;
  168.         spatialQuality:            CodecQ;
  169.         temporalQuality:        CodecQ;
  170.         similarity:                Fixed;
  171.         dataRateParams:            DataRateParamsPtr;
  172.         reserved:                LONGINT;
  173.     END;
  174.     CodecDecompressParams = RECORD
  175.         sequenceID:                ImageSequence;
  176.         imageDescription:        ImageDescriptionHandle;
  177.         data:                    Ptr;
  178.         bufferSize:                LONGINT;
  179.         frameNumber:            LONGINT;
  180.         startLine:                LONGINT;
  181.         stopLine:                LONGINT;
  182.         conditionFlags:            LONGINT;
  183.         callerFlags:            CodecFlags;
  184.         capabilities:            ^CodecCapabilities;
  185.         progressProcRecord:        ICMProgressProcRecord;
  186.         completionProcRecord:    ICMCompletionProcRecord;
  187.         dataProcRecord:            ICMDataProcRecord;
  188.         port:                    CGrafPtr;
  189.         dstPixMap:                PixMap;
  190.         maskBits:                BitMapPtr;
  191.         mattePixMap:            PixMapPtr;
  192.         srcRect:                Rect;
  193.         matrix:                    ^MatrixRecord;
  194.         accuracy:                CodecQ;
  195.         transferMode:            INTEGER;
  196.         frameTime:                ICMFrameTimePtr;
  197.         reserved:                ARRAY [0..0] OF LONGINT;
  198.         matrixFlags:            SInt8;
  199.         matrixType:                SInt8;
  200.         dstRect:                Rect;
  201.     END;
  202.  
  203. CONST
  204.     matrixFlagScale2x            = 1 * (2**(7));
  205.  
  206.  
  207. FUNCTION CDGetCodecInfo(storage: Handle; VAR info: CodecInfo): ComponentResult;
  208. FUNCTION CDGetCompressionTime(storage: Handle; src: PixMapHandle; {CONST}VAR srcRect: Rect; depth: INTEGER; VAR spatialQuality: CodecQ; VAR temporalQuality: CodecQ; VAR time: LONGINT): ComponentResult;
  209. FUNCTION CDGetMaxCompressionSize(storage: Handle; src: PixMapHandle; {CONST}VAR srcRect: Rect; depth: INTEGER; quality: CodecQ; VAR size: LONGINT): ComponentResult;
  210. FUNCTION CDPreCompress(storage: Handle; VAR params: CodecCompressParams): ComponentResult;
  211. FUNCTION CDBandCompress(storage: Handle; VAR params: CodecCompressParams): ComponentResult;
  212. FUNCTION CDPreDecompress(storage: Handle; VAR params: CodecDecompressParams): ComponentResult;
  213. FUNCTION CDBandDecompress(storage: Handle; VAR params: CodecDecompressParams): ComponentResult;
  214. FUNCTION CDCodecBusy(storage: Handle; seq: ImageSequence): ComponentResult;
  215. FUNCTION CDGetCompressedImageSize(storage: Handle; desc: ImageDescriptionHandle; data: Ptr; bufferSize: LONGINT; dataProc: ICMDataProcRecordPtr; VAR dataSize: LONGINT): ComponentResult;
  216. FUNCTION CDGetSimilarity(storage: Handle; src: PixMapHandle; {CONST}VAR srcRect: Rect; desc: ImageDescriptionHandle; data: Ptr; VAR similarity: Fixed): ComponentResult;
  217. FUNCTION CDTrimImage(storage: Handle; Desc: ImageDescriptionHandle; inData: Ptr; inBufferSize: LONGINT; dataProc: ICMDataProcRecordPtr; outData: Ptr; outBufferSize: LONGINT; flushProc: ICMFlushProcRecordPtr; VAR trimRect: Rect; progressProc: ICMProgressProcRecordPtr): ComponentResult;
  218. FUNCTION CDRequestSettings(storage: Handle; settings: Handle; VAR rp: Rect; filterProc: ModalFilterUPP): ComponentResult;
  219. FUNCTION CDGetSettings(storage: Handle; settings: Handle): ComponentResult;
  220. FUNCTION CDSetSettings(storage: Handle; settings: Handle): ComponentResult;
  221. FUNCTION CDCodecFlush(storage: Handle): ComponentResult;
  222. FUNCTION CDCodecSetTimeCode(storage: Handle; timeCodeFormat: UNIV Ptr; timeCodeTime: UNIV Ptr): ComponentResult;
  223.  
  224. {$ALIGN RESET}
  225. {$POP}
  226.  
  227. {$SETC UsingIncludes := ImageCodecIncludes}
  228.  
  229. {$ENDC} {__IMAGECODEC__}
  230.  
  231. {$IFC NOT UsingIncludes}
  232.  END.
  233. {$ENDC}
  234.